<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<header class="head">
	<section id="navOption">
		<nav class="shush-nav-hor">
			<ul>
				<li fix-anchor-tag="{'independentContent': 'true' }">
					<section class="item">
						<section class="wrap">
							<a href="${ baseURL }/home">Home</a>
						</section>
						<section class="background"></section>
					</section>
				</li>

				<c:if
					test="${currentUser.role == 'ROLE_USER' || currentUser.role == 'ROLE_ADMIN'}">
					<li fix-anchor-tag="{'independentContent': 'true' }">
						<section class="item">
							<section class="wrap">
								<a href="${ baseURL }/member/purchase">Purchasing Record</a>
							</section>
							<section class="background"></section>
						</section>
					</li>
				</c:if>

				<c:if test="${currentUser.role == 'ROLE_ADMIN'}">
					<li fix-anchor-tag="{'independentContent': 'true' }">
						<section class="item">
							<section class="wrap">
								<a href="${ baseURL }/admin">Administration Center</a>
							</section>
							<section class="background"></section>
						</section>
						<section class="nav-list">
							<ul>
								<li fix-anchor-tag="{'independentContent': 'true' }">
									<section class="item">
										<section class="wrap">
											<a href="${ baseURL }/admin/manage/book">Products
												Management</a>
										</section>
										<section class="background"></section>
									</section>
									<section class="nav-list">
										<ul>
											<li fix-anchor-tag="{'independentContent': 'true' }">
												<section class="item">
													<section class="wrap">
														<a href="${ baseURL }/admin/manage/book?action=list">List
															All Items</a>
													</section>
													<section class="background"></section>
												</section>
											</li>
											<li fix-anchor-tag="{'independentContent': 'true' }">
												<section class="item">
													<section class="wrap">
														<a href="${ baseURL }/admin/manage/book?action=new">New
															item</a>
													</section>
													<section class="background"></section>
												</section>
											</li>
										</ul>
									</section>
								</li>
								<li fix-anchor-tag="{'independentContent': 'true' }">
									<section class="item">
										<section class="wrap">
											<a href="${ baseURL }/admin/manage/refund">Order
												Management</a>
										</section>
										<section class="background"></section>
									</section>
									<section class="nav-list">
										<ul>
											<li fix-anchor-tag="{'independentContent': 'true' }">
												<section class="item">
													<section class="wrap">
														<a href="${ baseURL }/admin/manage/refund?action=list">List</a>
													</section>
													<section class="background"></section>
												</section>
											</li>
											<li fix-anchor-tag="{'independentContent': 'true' }">
												<section class="item">
													<section class="wrap">
														<a href="${ baseURL }/admin/manage/refund?action=refund">Refund
															Request</a>
													</section>
													<section class="background"></section>
												</section>
											</li>
										</ul>
									</section>
								</li>

								<li fix-anchor-tag="{'independentContent': 'true' }">
									<section class="item">
										<section class="wrap">
											<a href="${ baseURL }/admin/manage/member?action=list">Member
												Management</a>
										</section>
										<section class="background"></section>
									</section>
									<section class="nav-list">
										<ul>
											<li fix-anchor-tag="{'independentContent': 'true' }">
												<section class="item">
													<section class="wrap">
														<a href="${ baseURL }/admin/manage/member?action=list">List</a>
													</section>
													<section class="background"></section>
												</section>
											</li>
											<li fix-anchor-tag="{'independentContent': 'true' }">
												<section class="item">
													<section class="wrap">
														<a href="${ baseURL }/admin/manage/member?action=new">New
															Member</a>
													</section>
													<section class="background"></section>
												</section>
											</li>
										</ul>
									</section>
								</li>
								
								<li fix-anchor-tag="{'independentContent': 'true' }">
									<section class="item">
										<section class="wrap">
											<a href="${ baseURL }/admin/manage/statistic">Statistic</a>
										</section>
										<section class="background"></section>
									</section>
									<section class="nav-list">
										<ul>
											<li fix-anchor-tag="{'independentContent': 'true' }">
												<section class="item">
													<section class="wrap">
														<a href="${ baseURL }/admin/manage/statistic?action=book">Most
															Purchased Books</a>
													</section>
													<section class="background"></section>
												</section>
											</li>
											<li fix-anchor-tag="{'independentContent': 'true' }">
												<section class="item">
													<section class="wrap">
														<a
															href="${ baseURL }/admin/manage/statistic?action=refund">Most
															Refunded Books</a>
													</section>
													<section class="background"></section>
												</section>
											</li>
										</ul>
									</section>
								</li>
							</ul>
						</section>
					</li>
				</c:if>
			</ul>
		</nav>

		<c:if
			test="${currentUser.role != 'ROLE_USER' && currentUser.role != 'ROLE_ADMIN'}">
			<section class="shush-nav-anchor">
				<a id="shuhs-register" href="${ baseURL }/register">Become a
					Member</a>
			</section>

			<section class="shush-nav-anchor loginPanel">
				<a id="shuhs-login" href="${ baseURL }/login">Login</a>
				<div>
					<form action="${ baseURL }/login" method="post">
						<div class="control-group">
							<label for="username" class="control-label">Username:</label>
							<div class="controls">
								<input type="text" id="username" name="username" value=""
									required="required">
							</div>
						</div>

						<div class="control-group">
							<label for="password" class="control-label">Password:</label>
							<div class="controls">
								<input type="password" id="password" name="password"
									required="required">
							</div>
						</div>

						<input type="hidden" name="action" value="login_check" /> <input
							type="submit" id="_submit" name="_submit" class="btn btn-primary"
							value="Login">
					</form>
				</div>
			</section>
		</c:if>
		<c:if
			test="${currentUser.role == 'ROLE_USER' || currentUser.role == 'ROLE_ADMIN'}">
			<section class="shush-nav-anchor loginPanel">
				<a href="${ baseURL }/logout">(You have ${currentUser.loyaltyPoint} LP) Logout</a>
			</section>
		</c:if>

	</section>
</header>